A12 - Printer
提出
code: python
n, k = map(int, input().split())
a = list(map(int, input().split()))
# 1,2,3,4,5,6,7,8,9,10
# 2,4,6,8,10
# 3,6,9
# 4,8
# 秒数を全部集めるのは無理 O(pow(10, 9))
# O(N)
# 1 * 10
# 2 * 5
# 3 * 3
# 4 * 2
解答
code: python
n, k = map(int, input().split())
a = list(map(int, input().split()))
def check(x, n, k, a):
sum = 0
for i in range(n):
if sum >= k:
return True
return False
l = 1
r = 10 ** 9
while l < r:
mid = (l + r) // 2
ans = check(mid, n, k, a)
if ans:
r = mid
else:
l = mid + 1
print(l)